/*
** newprimesup.c for my_find_prime_sup in /home/labonn_c//Documents/piscine/Jour_O5
** 
** Made by christophe labonnemartinez
** Login   <labonn_c@epitech.net>
** 
** Started on  Tue Oct 11 10:45:44 2011 christophe labonnemartinez
** Last update Tue Oct 11 10:46:01 2011 christophe labonnemartinez
*/

int	prime(int nb)
{
  int	i;

  i = 2;
  if (nb == 0 || nb == 1)
    return (0);
  while (i < nb)
    {
      if (nb % i == 0)
	return (0);
      i = i + 1;
    }
  return (1);
}

int	my_find_prime_sup(nb)
{
  int	i;

  i = 0;
  while (i != 1)
    {
      i = prime(nb);
      nb = nb + 1;
    }
  nb = nb - 1;
  return (nb);
}
